<template>

  搜索：<input type="text" v-model="search">
  <button @click="OnEvent('传递参数给父亲')">接受函数并且传递参数给父亲</button>
</template>

<script>
export default {
  name: "Model",
  data(){
    return{
      search:""
    }
  },
  watch:{
    search(newV,oldV){
      this.$emit("ModelEvent",newV)
    }
  },
  props:{
    OnEvent:{
      type:Function
    }
  }
}
</script>

<style scoped>

</style>
